<script lang="ts" setup>
import { injectState } from '../state';

defineOptions({ name: 'Headler' });

const { selectedList, tableRef, detailDialogRef } = injectState()!;
</script>

<template>
  <div flex="~ justify-between">
    <div flex="~">
      <el-button type="primary" @click="detailDialogRef?.trigger('write')">
        <template #icon>
          <el-icon class="i-custom:add" />
        </template>
        新建
      </el-button>

      <el-button
        :disabled="selectedList.length === 0"
        @click="tableRef?.exportTable('文件', selectedList)"
      >
        <template #icon>
          <el-icon class="i-material-symbols:file-save-outline-rounded" />
        </template>
        导出
      </el-button>
    </div>
  </div>
</template>
